local cjson         = require('cjson.safe')

local res1,res2 = ngx.location.capture_multi({ {"/single"}, {"/skill"}})
if res1.status ~= 200 then
    ngx.status = 500
    return ngx.exit(500)
end
if res2.status ~= 200 then
    ngx.status = 500
    return ngx.exit(500)
end

-- res2 = cjson.decode(res2.body)
-- res1 = cjson.decode(res1.body)



-- local result = {}

-- for i=1,#res1 do
--     if result[res1[i]["name"]] == nil then
--         result[res1[i]["name"]] = {}
--     end
--     for j=1,#res2 do
--         if res1[i]["id"] == res2[j]["userid"] then
--             result[res1[i]["name"]][#result[res1[i]["name"]]+1] = res2[j]["skill"]
--         end
--     end
-- end


-- result =  cjson.encode(result)
-- ngx.say(result)
return res2.body..res1.body

